package top.meeting.room.common.kit;

import java.util.Arrays;
import java.util.List;

import top.meeting.room.module.system.model.User;

import java.util.stream.Collectors;

/**
 * Created by Lyt on 2017/9/15.
 */
public class PushMsgKit implements Runnable {
    private String content;
    private User[] users;

    public PushMsgKit(String content, User... users) {
        this.content = content;
        this.users = users;
    }

    @Override
    public void run() {
        WxKit.sendMessage(content,
                Arrays.stream(users).map(user -> user.getOpenId()).collect(Collectors.toList()));
    }
}
